package com.mew.slots.core.game.mjk.bo;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 特殊游戏类型
 * @author Dylin
 * @since 2019-11-28
 */
public enum MjkBonusType {
    HelpEgg(100,1, "救蛋"),
    OpenHat(101,2,"翻帽子"),
    ;

    private final static Map<Integer, MjkBonusType> stateMap
            = Arrays.stream(MjkBonusType.values()).collect(Collectors.toMap(MjkBonusType::code, code -> code));

    private final int code;
    private final int bonusType;
    private final String desc;

    /**
     * @param code 代码
     * @param desc 描述
     */
    private MjkBonusType(final int code,final int bonusType,final String desc) {
        this.code = code;
        this.bonusType = bonusType;
        this.desc = desc;
    }

    public int code() {
        return this.code;
    }
    public int getBonusType() {
        return this.bonusType;
    }

    /**
     * @param code 代码
     * @return 转换出来的状态码
     */
    public static MjkBonusType parse(int code) {
        return stateMap.get(code);
    }


}
